package com.suso56.apps.shipper.sph_shipper
import io.flutter.embedding.android.FlutterActivity
import com.baidu.mapapi.SDKInitializer
import android.os.Bundle
import com.baidu. mapapi. base. BmfMapApplication
import android.app.Application
import android.content. Context
import androidx.annotation.NonNull
import android.Manifest
import android.content.pm.PackageManager
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import io.flutter.plugins.GeneratedPluginRegistrant
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin
import io.flutter.plugins.videoplayer.*
class MainActivity: FlutterActivity() {


override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    SDKInitializer.setAgreePrivacy(this.application, true)
    SDKInitializer.initialize(this.application)

}
    override fun onRequestPermissionsResult(requestCode: Int, @NonNull permissions: Array<out String>, @NonNull grantResults: IntArray) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults)
        // 这里可以添加其他代码来处理权限结果，比如将结果传递给flutter_inappwebview插件
//
    }

    override fun configureFlutterEngine(@NonNull flutterEngine:
                                        FlutterEngine) {
        super.configureFlutterEngine(flutterEngine)
//        flutterEngine.getPlugins().add(SharedPreferencesPlugin())
//        flutterEngine.getPlugins().add(VideoPlayerPlugin())
          GeneratedPluginRegistrant.registerWith(flutterEngine)
    }

}
